home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 7: Sunsite
/
Linux Cubed Series 7 - Sunsite Vol 1.iso
/
system
/
backup
/
kbackup-.000
/
KBackup-1.2.7.tar
/
KBackup
/
kbinstall
< prev
next >
Wrap
Text File
|
1996-03-27
|
7KB
|
298 lines
#!/bin/sh
#
# KBInstall: Installation program for KBackup
#
# Copyright (C) 1995,1996 by Karsten Ballueder
# see manual for copyright details
#
# /home/kbackup/.CVSROOT/KBackup/kbinstall,v 1.18 1996/03/25 17:22:05 kbackup Exp
KBACKUP_VERSION="1.2.7"
DIALOG_SRC_FILE=src/dialog
if [ "$1" = --ttymode ]
then
echo "Entering tty-mode..."
TTYMODE=YES
fi
. src/paths
. src/checkprogs
check_progs
DIALOGTITLE="KBackup Installation Program (C) 1995, 1996 by Karsten Ballueder"
# show copyright:
$DIALOG --title " KBackup Installation: Copyright and Conditions of use" --textbox COPYING 22 77
if [ "$UID" != "0" ]
then
if ! $DIALOG --title " personal installation? " --yesno \
"
It seems that you are not the superuser (root). To
install KBackup and its support files properly, you
should have root privileges.
Of course, as a normal user, you can also install
KBackup in your own directories, but this is not
recommended.
Continue with installation?
" 14 56
then
exit 0
fi
fi
# report missing programs:
if [ "$HasNot" != "" ]
then
if ! $DIALOG --title " Error! " --yesno \
"
KBackup requires some other programs to be installed on your system.
It seems that the following programs are not yet installed:
$HasNot
If they should already be installed, you can edit the 'paths' file in
this directory to make sure KBackup can find them. Otherwise, you should
install them, or KBackup will not work properly.
In the manual you can find further information on where to get those
programs. You can also check the WWW KBackup homepage at:
http://www.uni-karlsruhe.de/~Karsten.Ballueder
Continue with installation?
" 18 77
then
exit 0
fi
fi
# ask for directories:
if $DIALOG --title " KBackup data directory " --inputbox "
KBackup maintains several user defined configurations and creates
rather big logfiles during operation.
As it is able to read backups without access to these files, they
can be safely put on a mounted filesystem.
A reasonable place for them would be \"$kbackdir\".
Press ENTER to confirm this default, or enter a path of your
choice:
" 18 76 2>/tmp/.tmp$$
then
ddir=`cat /tmp/.tmp$$`
if [ "$ddir" != "" ]
then
kbackdir=$ddir
fi
fi
datadir="$kbackdir/Data"
if $DIALOG --title " KBackup program directory " --inputbox "
Where do you want to install the \"kbackup\" program itself?
A reasonable place for this would be \"$progdir\".
Press ENTER to confirm this default, or enter a path of your
choice:
" 15 76 2>/tmp/.tmp$$
then
pdir=`cat /tmp/.tmp$$`
if [ "$pdir" != "" ]
then
progdir=$pdir
fi
fi
if $DIALOG --title " KBackup config directory " --inputbox "
KBackup needs a place where to store its configuration files
and some of its source. These files should be available whenever
it is run, so they should be put somewhere on the root filesystem.
A reasonable place for them would be \"$srcdir\".
Press ENTER to confirm this default, or enter a path of your
choice:
" 18 76 2>/tmp/.tmp$$
then
sdir=`cat /tmp/.tmp$$`
if [ "$sdir" != "" ]
then
srcdir=$sdir
fi
fi
# MultiBuf:
#if ! [ -x multibuf/multibuf ]
#then
$DIALOG --title " KBackup: Installation of MultiBuf" --infobox "
For handling multi-volume archives, KBackup uses the MultiBuf
program included in this distribution. It will now be compiled
from its source.
Compiling MultiBuf program... (should take just few seconds)
" 9 67
cd multibuf
if ! make multibuf >/dev/null 2>/dev/null
then
$DIALOG --title " Installation error! " --msgbox "
Couldn't compile multibuf program!
KBackup needs it for its operation, so
you have to go to the multibuf/ directory,
compile it yourself and install somewhere
in your binaries path (e.g. /bin).
Sorry. (Please, report this bug!)" 15 60
fi
cd ..
#fi
$DIALOG --title " KBackup Installation " --infobox "
Creating directories... " 5 40
install -m 0755 -d $kbackdir
if [ -d $kbackdir/Default ]
then
$DIALOG --title " KBackup Installation " --yesno "
Old KBackup data files found
(Configuration-/Log-Files).
Do you want to keep them?" 9 35
if [ $? = 0 ]
then
install -m 0755 -d $datadir
tmp=`pwd`
( cd $kbackdir; for i in * ; do install -m 0755 -d $datadir/$i.old && cp -ar $kbackdir/$i $datadir/$i.old && rm -rf $i ; done )
cd "$tmp"
else
rm -rf $kbackdir/*
fi
fi
install -m 0755 -d $kbackdir
install -m 0755 -d $datadir
cd data
for i in * ; do install -m 0755 -d $datadir/$i ; done
cd ..
install -d $progdir
install -d $srcdir
$DIALOG --title " KBackup Installation " --infobox "
Installing config files / source..." 5 40
cd src
echo "# settings added by kbinstall:
datadir=\"$datadir\"
docdir=\"$docdir\"
progdir=\"$progdir\"
srcdir=\"$srcdir\"
kbackdir=\"$kbackdir\"
" | cat paths - >tmp$$ && mv tmp$$ paths
install -m 0644 * $srcdir
cd ..
$DIALOG --title " KBackup Installation " --infobox "
Installing Programs..." 5 40
echo -e "#!/bin/sh\nSRCDIR=$srcdir\n" | cat - kbackup >.tmp$$
mv kbackup kbackup.bak
mv .tmp$$ kbackup
install -m a=rx kbackup $progdir
mv kbackup.bak kbackup
rm -f $progdir/multibuf # otherwise file gets longer and longer, bug in install?
install -s multibuf/multibuf $progdir
install -m 0644 multibuf/multibuf.1 /usr/man/man1
install -m 0644 docs/kbackup.1 /usr/man/man1
$DIALOG --title " KBackup Installation " --infobox "
Installing sample configurations... " 5 40
cd data
for i in * ; do install -m 0644 $i/* $datadir/$i ; done
cd ..
cat >$HOME/.kbackrc <<_EOF_
#
# KBackup rc file
#
kbackdir=$kbackdir
datadir=$datadir
configname=Default
_EOF_
$DIALOG --title " KBackup Installation " --infobox "
Installing documentation in
\"$docdir\"..." 6 40
install -d $docdir
install -d $docdir/html
install -m 0644 docs/* $docdir 2>/dev/null
install -m 0644 docs/html/* $docdir/html
if [ "$HasAFIO" = "NO" ]
then
if $DIALOG --title " KBackup Installation " --yesno "
It seems that you don't have the afio(1) program installed.
Do you want to use the binary included in this package?
(This is HIGHLY recommended! It's in ELF format.)
" 10 70
then
$DIALOG --title " KBackup Installation " --infobox "
Installing afio in /bin, /usr/man/man1
" 6 45
install -m 0755 tools/bin/afio /bin
install -m 0644 tools/man/afio.1 /usr/man/man1
fi
fi
if [ "$DIALOG" = "dialog" ] # Ah, still using version 0.3...
then
if $DIALOG --title " KBackup Installation " --yesno "
The version of the dialog(1) program installed on your system
is outdated.
Do you want to replace it by the one from this package?
(This is no official version, I made some minor patches and
recompiled it to be 8bit clean. In a.out format.)
" 9 75
then
$DIALOG --title " KBackup Installation " --infobox "
Installing dialog in /bin, /usr/man/man1
" 6 47
install -m 0755 tools/bin/dialog /bin
install -m 0644 tools/man/dialog.1 /usr/man/man
fi
fi
rm -f /tmp/.tmp$$
$DIALOG --title " KBackup Installation " --msgbox "
Installation of KBackup is complete.
Its documentation can be found under \"$docdir\".
For further information and latest notes, you can refer to
the KBackup home page in the WWW:
http://www.uni-karlsruhe.de/~Karsten.Ballueder
To start the program, type \"kbackup\".
" 16 63
clear